home *** CD-ROM | disk | FTP | other *** search
/ Win Platinum / Win Platinum.iso / util / filecmdr / wwwfmext.fme < prev   
Encoding:
Text File  |  1992-03-02  |  9.6 KB  |  297 lines

  1. ; AutoExec Section is on top here.  Actually runs before file manager
  2. ; appears on the   screen
  3.  
  4.         TAB=num2char(9)
  5.         CR=strcat(num2char(13),num2char(10))
  6. ;       if !WinExist("Clock") then Run("Clock.exe","")
  7.  
  8. Edit FM Extender menu
  9.         a=FileLocate("wwwfmext.fme")
  10.         adir=FilePath(a)
  11.         DirChange(adir)
  12.         aroot=FileRoot(a)
  13.         bname=strcat(aroot,".BAK")
  14.         FileCopy(a,bname,@FALSE)
  15.         run("notepad.exe","wwwfmext.fme")
  16.  
  17. _Bro&wse...
  18.         l=CurrentFile()
  19.         run("browser.exe",l)
  20.         drop(a,l)
  21. &Edit...
  22.         l=CurrentFile()
  23.         ;if !IsKeyDown(@SHIFT) then l=askline("Edit","Enter file to edit",l)
  24.         if l=="" || l==" " then goto NULL
  25.         a=strscan(l,".\",0,@BACKSCAN)
  26.         if a==0 then l=strcat(l,".")
  27.         if a==0 then goto NULL
  28.         if strsub(l,a,1)!="." then l=strcat(l,".")
  29.      :NULL
  30.         run("notepad.exe",strtrim(l))
  31.         drop(a,b,l)
  32. Utilities
  33.  &Freespace on Local Drives   
  34.  
  35.         Drive=DiskScan(2)     ; 2 is the code for local hard drives
  36.         Dmax=strlen(Drive)
  37.         DIndex=1
  38.         TotalSize=0
  39.         DriveReport=""
  40.  
  41.         :COUNTSPACE
  42.         NextDrive=StrSub(Drive,Dindex,1)
  43.         a=DiskFree(NextDrive)/1024
  44.         TotalSize=a+TotalSize
  45.         DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
  46.         DIndex=Dindex+3  ;each entry is 3 bytes long
  47.         if DIndex<=Dmax then goto COUNTSPACE
  48.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  49.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  50.  
  51.  &Wallpaper
  52.            DirChange(dirWindows(0))
  53.            a=FileItemize("*.BMP")
  54.            a=strcat("-None- ",a)
  55.            a=ItemSelect("Select New Wallpaper",a," ")
  56.            terminate(a=="","Wallpaper","No wallpaper selected")
  57.            if a=="-None-" then Wallpaper("",0)
  58.            if a=="-None-" then exit
  59.            tile=@FALSE
  60.            if FileSize(a)<40000 then tile=@TRUE  
  61.            ;if bmp size less than 40K, assume tile, else center
  62.            Wallpaper(a,tile)
  63.            drop(a,b,tile)
  64.  Edit &INI files
  65.         DirChange(DirWindows(0))
  66.         canned="BYEBYE"
  67.         IniFiles=""
  68.  
  69.         :UP1
  70.         canned="byebye"
  71.         If IniFiles!="" then goto inied
  72.         IniFiles=FileItemize("*.INI")
  73.         :inied
  74.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  75.         if TheFile=="" then goto newini
  76.         Sections=""
  77.  
  78.         :UP2
  79.         canned="up1"
  80.         if Sections!="" then goto sected
  81.         Sections=IniItemizePvt("",TheFile)
  82.         :SECTED
  83.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  84.         if Section=="" then goto AddSect
  85.         KeyValues=""
  86.  
  87.         :UP3
  88.         canned="up2"
  89.         if KeyValues!="" then goto looped
  90.         Keys=IniItemizePvt(Section,TheFile)
  91.         KeyMax=ItemCount(Keys,TAB)
  92.         KeyIndex=0
  93.  
  94.         :Loop
  95.         if KeyIndex==KeyMax then goto looped
  96.         KeyIndex=KeyIndex+1
  97.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  98.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  99.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  100.         goto Loop
  101.  
  102.         :looped
  103.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  104.         if Key=="" then goto AddKey
  105.         Key=ItemExtract(1,Key,"=")
  106.  
  107.         Value=IniReadPvt(Section,Key,"???",TheFile)
  108.         goto entkey
  109.  
  110.  
  111.         :newini
  112.         canned="UP1"
  113.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  114.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  115.         IniFIles=""
  116.         goto AddSectNewIni
  117.  
  118.         :AddSect
  119.         canned="up2"
  120.         :AddSectNewIni
  121.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  122.         Sections=""
  123.         goto AddKeyNewSect
  124.  
  125.         :AddKey
  126.         canned="up3"
  127.         :AddKeyNewSect
  128.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  129.         Value="(Undefined)"
  130.         KeyValues=""
  131.         goto EntKeyNewKey
  132.  
  133.         :ENTKEY
  134.         canned="up3"
  135.         :EntKeyNewkey
  136.         NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  137.         if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  138.         KeyValues=""
  139.         goto up3
  140.  
  141.         :CANCEL
  142.         goto %Canned%
  143.  
  144.         :BYEBYE
  145.         exit
  146.  
  147.  Clipboard Tricks
  148.   Path and Filename to Clipboard
  149.         Clipput(strcat(DirGet(),CurrentFile()))
  150.   Copy &Directory to Clipboard
  151.         a=FileItemize("*.*")
  152.         a=StrReplace(a," ",cr)
  153.         ClipPut(a)
  154.         Drop(a)
  155.   Copy &Hilited files to Clipboard
  156.         a=FileItemize("")
  157.         a=StrReplace(a," ",cr)
  158.         ClipPut(a)
  159.         Drop(a)
  160.   Copy &Hilited dirs to Clipboard
  161.         a=DirItemize("")
  162.         a=StrReplace(a," ",cr)
  163.         ClipPut(a)
  164.         Drop(a)
  165.   Copy &Special Characters to Clipboard
  166.        a=" í| ó| ú| ñ| Ñ| ª| º| ¿| ⌐| ¬|"       ;161 thru 170
  167.        b=" ½| ¼| ¡| «| »| ░| ▒| ▓| │| ┤|"       ;171 thru 180
  168.        c=" ╡| ╢| ╖| ╕| ╣| ║| ╗| ╝| ╜| ╛|"       ;181 thru 190
  169.        d=" ┐| └| ┴| ┬| ├| ─| ┼| ╞| ╟| ╚|"       ;191 thru 200
  170.        e=" ╔| ╩| ╦| ╠| ═| ╬| ╧| ╨| ╤| ╥|"       ;201 thru 210
  171.        f=" ╙| ╘| ╒| ╓| ╫| ╪| ┘| ┌| █| ▄|"       ;211 thru 220
  172.        g=" ▌| ▐| ▀| α| ß| Γ| π| Σ| σ| µ|"       ;221 thru 230
  173.        h=" τ| Φ| Θ| Ω| δ| ∞| φ| ε| ∩| ≡|"       ;231 thru 240
  174.        i=" ±| ≥| ≤| ⌠| ⌡| ÷| ≈| °| ∙| ·|"       ;241 thru 250
  175.        j=" √| ⁿ| ²| ■|  "                       ;251 thru 255
  176.        a=strcat(a,b,c,d,e,f,g,h,i,j)
  177.        Drop(b,c,d,e,f,g,h,i,j)
  178.        a=ItemSelect("Choose a character",a,"|")
  179.        a=strsub(a,2,1)
  180.        ClipPut(a)
  181.        Drop(a)
  182.  
  183.  
  184. Accessories
  185.  Appointment   Scheduling
  186.            run("Calendar.exe","")
  187.  Calculator
  188.            run("calc.exe","")
  189.  
  190.  C&lipboard
  191.         errormode(@off)
  192.         terminate(winactivate("Clipboard"),"","") ;Already Running
  193.         errormode(@cancel)
  194.         run("Clipbrd.exe","")
  195.  
  196.  Clock
  197.         run("clock.exe","")
  198.  
  199.  Control &Panel
  200.         errormode(@off)
  201.         terminate(winactivate("Control Panel"),"","")
  202.         errormode(@cancel)
  203.         run("control.exe","")
  204.  Cardfile
  205.            run("cardfile.exe","")
  206.  
  207.  Notepad Editor
  208.            run("notepad.exe","")
  209.  
  210.  Paint
  211.            run("pbrush.exe","")
  212.  
  213.  Write
  214.            run("write.exe","")
  215.  
  216.  Run System Confi&guration Editor
  217.            run("sysedit.exe","")  ;takes care of itself
  218.  Run Windows Setup
  219.         DirChange(DirWindows(0))
  220.         run("setup.exe","")
  221.         drop(a)
  222.  _PIF Edi&t...
  223.         a=strupper(FileExtension(CurrentFile()))
  224.         if a!="PIF" then goto PIF2
  225.         run("pifedit.exe",CurrentFile())
  226.         exit
  227.         :PIF2
  228.         if IsKeyDown(@SHIFT)==@YES then DirChange(FilePath(FileLocate("_default.pif")))
  229.         a=FileItemize("*.PIF")
  230.         if a==""  then DirChange(FilePath(FileLocate("_default.pif")))
  231.         if a=="" then a=FileItemize("*.PIF")
  232.         a=ItemSelect("Choose a PIF File to edit",a," ")
  233.         run("pifedit.exe",a)
  234.         exit
  235. _&System Information
  236.        wintype="retail"
  237.        if WinMetrics(22) then wintype="debug"
  238.  
  239.         wc=WinConfig()
  240.         if !(wc&1) then mode="Real"
  241.         if wc&16 then mode="Standard"
  242.         if wc&32 then mode="Enhanced"
  243.  
  244.         if wc&2 then cpu=286
  245.         if wc&4 then cpu=386
  246.         if wc&8 then cpu=486
  247.         if wc&64 then cpu=8086
  248.         if wc&128 then cpu=80186
  249.  
  250.         Sysinfo=strcat(cpu,' ',mode,' ',wintype,' Windows ',WinVersion(1),'.',WinVersion(0),CR)
  251.  
  252.         math="No math"
  253.         if wc&1024 then math="Math"
  254.         mouse="No Mouse"
  255.         if WinMetrics(19) then mouse="Mouse"
  256.  
  257.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',CR)
  258.  
  259.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",CR)
  260.  
  261.         ErrorMode(@OFF)
  262.         LastError()
  263.         PlayMedia("Status WaveForm Ready")
  264.         ErrorMode(@CANCEL)
  265.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)
  266.  
  267.         bug=NetGetCaps(2)
  268.         if bug==0 then math="No n"
  269.         if bug!=0 then math="N"
  270.         if bug==256 then math="Microsoft n"
  271.         if bug==512 then math="Lan Manager n"
  272.         if bug==768 then math="Novell NetWare n"
  273.         if bug==1024 then math="Banyan Vines n"
  274.         if bug==1280 then math="10 Net n"
  275.         sysinfo=strcat(sysinfo,math,"etwork installed.",CR)
  276.  
  277.         bug=WinResources(0)/1024   ; Compute memory avail
  278.         math=strlen(bug)
  279.         if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  280.  
  281.         sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  282.         sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  283.  
  284.         sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),CR)
  285.         disks=DiskScan(1)
  286.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
  287.         disks=DiskScan(2)
  288.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
  289.         disks=DiskScan(4)
  290.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
  291.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
  292.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),CR)
  293.         sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())
  294.  
  295.         ver=Version()
  296.         Message("File Commander %ver% SysInfo",Sysinfo)
  297.